﻿using HotFolderServiceInterface;
using NLog;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.Composition;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HotFolderTask
{

    [Export(typeof(IHotFolderType))]
    public class SimpleFileCopier :IHotFolderType
    {
        protected ILogger logger;

        [ImportingConstructor]
        public SimpleFileCopier([Import("Logger")]ILogger logger)
        {
            this.logger = logger;
        }

       
        public string HotFolderTypeName
        {
            get { return "SimpleFileCopier"; }
        }

        public void Execute(String name, String path, NameValueCollection settings)
        {

            logger.Trace("Logging from simplefilecopier");
            System.IO.File.Copy(path, "c:\\temp\\" + name + ".copy");
        }


    }
}
